package org.wu.framework.lazy.orm.core.config.prop;



import org.wu.framework.lazy.database.datasource.proxy.builder.LazyWideDataSourceBuild;

import javax.sql.DataSource;

public class DefaultLazyDataSourceAttribute extends AbstractLazyDataSourceAttribute {
    /**
     * 获取数据源
     *
     * @return 数据源
     */
    @Override
    public DataSource doGetDatasource() {
        LazyWideDataSourceBuild lazyWideDataSourceBuild = new LazyWideDataSourceBuild();
        lazyWideDataSourceBuild.url(getUrl())
                .driverName(switchDriverClassName())
                .username(getUsername())
                .password(getPassword());
        return lazyWideDataSourceBuild.build();
//        throw new IllegalArgumentException("无法创建数据源");
    }
}
